package chapter;

import java.util.NavigableMap;
//TODO 匿名类；所谓的匿名类就是没有名字的类，只用指向类中的方法和功能
public class object_NoName {
    public static void main(String[] args) {
    Me me = new Me();
    //me.sayhellow(new Zyh());
    me.sayhellow(new NoName() {
        public String name() {
            return "qxy";
        }
    });
    }
}
abstract class NoName {
    public abstract String name();
}
class Me {
    public void sayhellow(NoName noName) {
        System.out.println("hello" + noName.name());
    }
}
class Zyh extends NoName {
    public String name() {
        return "Zyh";
    }
}